function insert_TransactionTable(str)
%ID_Security, dd, mm, yyyy, OpenPrice, HighPrice, LowPrice, ClosePrice,
%Volume
% Database Server
host = 'localhost';

% Database Username/Password
user = 'root';
password = 'root';


% Database Name

dbName = 'securitiesdb';

% JDBC Parameters
jdbcString = sprintf('jdbc:mysql://%s/%s', host, dbName);
jdbcDriver = 'com.mysql.jdbc.Driver';
% Set this to the path to your MySQL Connector/J JAR

javaaddpath('mysql-connector-java-5.1.6-bin.jar')

% Create the database connection object
dbConn = database(dbName, user , password, jdbcDriver, jdbcString);

% Check to make sure that we successfully connected
if isconnection(dbConn)
    % Fetch the symbol, market cap, and last close for the 10 largest
    listFile = dir(str);
    
    for i = 3: (sum(size(listFile)) - 1)
        
        [num, text, table] = xlsread(strcat(str, '\', listFile(i).name));
        
        ID = selectData(strcat('Select ID from Security Where Name =', '''', table(3, 1),'''', ';'));
        if (cell2mat(ID) ~= 0)
            [n m] = size(table);
            for j = 3: n
                datestr = cell2mat(table(j, 3));
                date = strcat(datestr(7:10), '/', datestr(1: 2), '/', datestr(4:5));
                
                insert(dbConn,'Transaction',{'ID_Security', 'Date', 'OpenPrice', 'HighPrice', 'LowPrice', 'ClosePrice', 'Volume'}, ...
                    {cell2mat(ID), date, cell2mat(table(j, 5)), cell2mat(table(j, 6)), cell2mat(table(j, 7)), cell2mat(table(j, 8)),...
                    cell2mat(table(j, 9))});
            end
        end
    end
    
    
        
%    insert(dbConn,'Transaction',{'ID_Security', 'Date', 'OpenPrice', 'HighPrice', 'LowPrice', 'ClosePrice', 'Volume'}, ...
%       {[num2str(ID_Security) num2str(ID_Security)], [date date], [num2str(OpenPrice) num2str(OpenPrice)], ...
%       [num2str(HighPrice) num2str(HighPrice)], [num2str(LowPrice) num2str(LowPrice)], [num2str(ClosePrice) num2str(ClosePrice)],...
%       [num2str(Volume) num2str(Volume)]});
    
    % 1
    % If the connection failed, print the error message
else
    % 0
    disp(sprintf('Connection failed: %s', dbConn.Message));
end

% Close the connection so we don't run out of MySQL threads
close(dbConn);

end